/*
 * Global.h
 *
 *  Created on: 2013-1-23
 *      Author: heqiu
 */

#ifndef GLOBAL_H_
#define GLOBAL_H_

#include "Guud.h"
#include "GameConfig.h"
#include "GameListener.h"
#include "GameDrawThread.h"
#include "CanvasWelcome.h"
#include "CanvasStory.h"
#include "CanvasControl.h"
#include "BuildingManager.h"
using namespace guud;

class GlobalData {
public:
	GlobalData();
	~GlobalData();
	GuudLock m_GuudLock;	//多线程数据锁
	GuudLog m_GuudLog;
	GuudScreen * m_pGuudScreen;	//屏幕
	GuudMap * m_pGuudCanvasMap;	//当前的地图画布
	GuudCanvas * m_pGuudCanvasWelcome;	//当前的地图画布
	GuudCanvas * m_pGuudCanvasControl;	//控制面板
	GameConfig m_config_game;	//游戏全局配置
	GameConfig m_config_save;	//游戏保存配置
	GameConfig m_config_story;	//当前游戏故事配置
	GameConfig * m_pConfig_map;	//游戏当前地图配置
	BuildingManager m_BuildingManager;

	GameListener m_GameListener;	//游戏事件监听器
	GameDrawThread m_GameDrawThread;	//绘图线程
	GuudFont m_GuudFont;	//字体

};
extern GlobalData g_GlobalData;

void pressed_button_exit(void * pData, GuudButton * pButton);
void pressed_button_begin(void * pData, GuudButton * pButton);
void pressed_button_save(void * pData, GuudButton * pButton);
void config_save_update();
#endif /* GLOBAL_H_ */
